import 'package:flutter/material.dart';

class GlobalThemData {
  static final Color _lightFocusColor = Colors.black.withOpacity(0.12);
  static final Color _darkFocusColor = Colors.white.withOpacity(0.12);
  static ThemeData lightThemeData = themeData(lightColorScheme, _lightFocusColor);
  static ThemeData darkThemeData = themeData(darkColorScheme, _darkFocusColor);

  static ThemeData themeData(ColorScheme colorScheme, Color focusColor) {
    return ThemeData(
        useMaterial3: true,
        colorScheme: colorScheme,
        focusColor: focusColor,
        textSelectionTheme: TextSelectionThemeData(
          cursorColor: colorScheme.surface,
          selectionColor: colorScheme.onSurface.withOpacity(0.3),
          selectionHandleColor: colorScheme.surface.withOpacity(0.75),
        ),
    );
  }

  // 亮色配色
  static const ColorScheme lightColorScheme = ColorScheme(
    primary: Color(0xff469bcf),
    onPrimary: Color(0xff278abf),
    secondary: Color(0xffdff3ff),
    onSecondary: Color(0xffffffff),
    error: Color(0xffe36060),
    onError: Color(0xfff44363),
    background: Colors.white,
    onBackground: Colors.white,
    surface: Color(0xFFFFFFFF),
    onSurface: Color(0xff131313),
    brightness: Brightness.light,
  );

  // 暗色模式
  static const ColorScheme darkColorScheme = ColorScheme(
    primary: Color(0xff1c729f),
    secondary: Color(0xff506a7e),
    surface: Color(0xff120e0e),
    background: Color(0xff252e35),
    onBackground: Color(0x0DFFFFFF),
    error: Color(0xffaf4d58),
    onError: Color(0xffae364c),
    onPrimary: Colors.white,
    onSecondary: Colors.white,
    onSurface: Colors.white,
    brightness: Brightness.dark,
  );
}